package com.lagou.edu.dao;

import com.lagou.edu.pojo.LagouToken;
import com.lagou.edu.pojo.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author wyx
 * @Date 2020/5/5 23:49
 */
public interface LagouTokenDao extends JpaRepository<LagouToken,Long> {

    @Query(value = "select email from lagou_token  where token=?1",nativeQuery = true)
    String findByToken(String token);


    /**
     * 使用原生sql语句查询，需要将nativeQuery属性设置为true，默认为false（jpql）
     * @param name
     * @param address
     * @return
     */
    @Query(value = "select * from tb_resume  where name like ?1 and address like ?2",nativeQuery = true)
    List<UserInfo> findBySql(String name, String address);




}
